<%= render :partial =>'/store/toolbar'%>
<div id="content_container">
  <% if @agents && @agents.length > 0 %>
    <div class="title"><span class='title_content'>代理商列表</span></div>
    <table class="admin"  cellpadding="0" cellspacing="0" >
      <thead>
        <tr>
          <th>用户名</th>
          <th>email</th>
          <th>投放网站</th>
          <th>状态</th>
          <th>佣金</th>
          <th>优惠码</th>
          <th>操作</th>
        </tr>
      </thead>
      <% for user in @agents %>
        <tr>
          <td><%= user.login%></td>
          <td><%= user.email %></td>
          <td><%= user.site %></td>
          <td><%= user.agent_status ? format_user_status(user.agent_status):"<span style='color:green;'>正常</span>"  %></td>
          <td ><%= user.account %></td>
          <td><%= user.code%></td>
          <td style="width:4em;" class="action_link"><%= link_to '删除', user, :confirm => '确定删除?', :method => :delete,:class=>"action_delete" %></td>
        </tr>
      <% end %>
    </table>
  <%  end %>

  <% if @applicants && @applicants.length > 0 %>
    <div class="title"><span class='title_content'>以下用户正在申请代理商资格:</span></div>
    <table class="admin"  cellpadding="0" cellspacing="0" >
      <thead>
        <tr>
          <th>用户名</th>
          <th>email</th>
          <th>投放网站</th>
          <th>状态</th>
          <th>操作</th>
        </tr>
      </thead>
      <% for user in @applicants %>
        <tr>
          <td><%= user.login%></td>
          <td><%= user.email %></td>
          <td><%= user.site %></td>
          <td><%= user.agent_status ? format_user_status(user.agent_status):"<span style='color:green;'>正常</span>"  %></td>
          <td><%= link_to '通过申请',"/users/activation_agent/#{user.id}"%></td>
        </tr>
      <% end %>
    </table>
  <% end %>

  <% if @withdraws && @withdraws.length > 0  %>
    <div class="title"><span class='title_content'>以下用户正在申请账户提现:</span></div>
    <table class="admin"  cellpadding="0" cellspacing="0" >
      <thead>
        <tr>
          <th>用户名</th>
          <th>银行账号</th>
          <th>开户人</th>
          <th>佣金</th>
          <th>状态</th>
          <th>操作</th>
        </tr>
      </thead>
      <% for user in @withdraws %>
        <tr>
          <td><%= user.login%></td>
          <td><%= user.bank_account %></td>
          <td><%= user.account_name %></td>
          <td><%= user.account  %></td>
          <td ><%= user.agent_status ? format_user_status(user.agent_status):"<span style='color:green;'>正常</span>"  %></td>
          <td><%= link_to '进行提现操作',"/withdraws/new/#{user.id}"%></td>
        </tr>
      <% end %>
    </table>
  <% end %>
</div>